﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<GlobalTask>" %>
<%@ Import Namespace="ViewRes" %>
 
<div class="container">
    <%
        using (
            Html.BeginRouteForm("Default", new { controller = "GlobalTasks", action = "GlobalTaskStatusEdit", globalTaskId = Model.CheckPointId, studentId = ((Student)ViewData["Student"]).UserId },
                               FormMethod.Post))
        {%>
          <%:Html.HiddenFor(s => s.CheckPointId)%>
          <tr>
            <td>
               <%:LecturerStrings.Completed%>
            </td>
            <td>
         <%if (ViewData["PreviousTaskCompletion"]!= null && !(bool)ViewData["PreviousTaskCompletion"])
           {%>
                 <%:LecturerStrings.CopletePrevious%>
        <%}
           else if (ViewData["NextTaskCompletion"] != null && (bool)ViewData["NextTaskCompletion"] == true)
           {%>
               <%:LecturerStrings.CantEditGTStatus%>
          <% }
           else
           {%>
          <%:Html.CheckBox("isCompleted", (bool)ViewData["ThisTaskCompletion"])%>
                          
            </td>
        </tr>
    <div style="float: right">
        <input type="submit" value="OK" />
    </div>
     <%
         } %>
    <%
        }%>
</div>